package com.xx.controller;

import com.xx.entity.User;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("users")
public class UserResController {
    //新增用户  post
    @PostMapping
    public String saveUser(@RequestBody User user){
        return "新增用户!";
    }
    @PutMapping
    public String updateUser(@RequestBody User user){
        return "修改用户!";
    }
    @DeleteMapping("/{userId}")
    public String delUser(Integer userId){
        return "删除用户!";
    }
    @GetMapping
    public List<User> getList(){
        System.out.println("获取全部的结果集");
        return null;
    }
    @GetMapping("/{id}")
    public User getUserInfo(@PathVariable Integer userId){
        System.out.println("返回单个用户信息");
        return null;
    }
}
